/**
 * 
 */
package model.subjects;

import java.util.LinkedList;

import model.Attribute;

import database.dao.CustomerDAO;
import database.dao.EmployeeDAO;
import database.dao.EnterpriseDAO;

/**
 * @author Triin
 *
 */
public class EnterpriseCustomer extends Enterprise implements Customer{
	int customerId;
	//CustomerDAO customerDao = new CustomerDAO();
	//EnterpriseDAO enterpriseDao = new EnterpriseDAO();
	private LinkedList<Attribute> attributeNames;
	
	public EnterpriseCustomer(){
		this.attributeNames = CustomerDAO.findAttributeNames();
	}
	public EnterpriseCustomer enterpriseCustomerFromDB(){
		CustomerDAO dao = new CustomerDAO();
		LinkedList<Attribute> newAttributes = dao.findCustomerAttributes(this.getId());
		for(Attribute a: newAttributes){
			this.addAttribute(a);
		}
		return this;
	}

	public LinkedList<Attribute> getAttributeNames(){
		return attributeNames;
	}

	public void setAttributeNames(LinkedList<Attribute> names){
		this.attributeNames = names;
	}

	@Override
	public void setCustomerId(int customerId) {
		this.customerId = customerId;
	}

	@Override
	public int getCustomerId() {
		return this.customerId;
	}

}
